using HKB.Common;
using System;
using System.Data;
using System.Web;
namespace HKB.Web
{
	public class Shop_OrderItem
	{
		private Conn conn;
		public Shop_OrderItem()
		{
			this.conn = Text.GetComponent<Conn>("conn", HttpContext.Current.CurrentHandler);
		}
		public Shop_OrderItem(Conn _conn)
		{
			this.conn = _conn;
		}
		public DataTable GetByOrderID(int OrderFormID)
		{
			return this.conn.GetDataTable("Select * From [HLShop_OrderItem] Where OrderFormID=" + OrderFormID);
		}
		public DataTable GetByOrderNum(string OrderFormNum)
		{
			return this.conn.GetDataTable("Select * From [HLShop_OrderItem] Where OrderFormNum='" + OrderFormNum + "'");
		}
		public DataTable GetPartItemByOrderID(int OrderFormID)
		{
			string sql = "select oi.ProductID,oi.Quantity,oi.Price,p.PUnit from HLShop_OrderItem as oi,HLShop_Product as p where p.ProductID=oi.ProductID and OrderFormID=" + OrderFormID;
			return this.conn.GetDataTable(sql);
		}
		public DataTable GetOrderItemByID(int ID)
		{
			string sql = "Select * From [HLShop_OrderItem] Where ID=" + ID;
			return this.conn.GetDataTable(sql);
		}
	}
}
